﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Resources.SendSMS_Title %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="maincontent" id="tabcontent">
        <h2>
            <%: Resources.SendSMS_Title %>
          <%-- <% Html.Resource("SendSMS_Title"); %>--%>
        </h2>
        <div id="sendsms">
            <% using (Html.BeginForm("Send", "Send", FormMethod.Post))
               { %>
            <div class="to">
                <div class="tips">
                    <div class="label">
                        <%:Resources.SendSMS_Tip %></div>
                    <div class="content">
                        <%:Resources.SendSMS_Tip_Content_Num %></div>
                </div>
                <span class="label"><a href="#" class="selectto"><%:Resources.SendSMS_To %></a></span><span class="input">
                    <textarea name="addresslist" class="addresslist"></textarea></span><span class="plus">
                        <img src="<%:Url.Content("~/Content/images/icons/plus.png")%>" width="12" height="12"
                            alt="+" /></span> <span class="lessen">
                                <img src="<%:Url.Content("~/Content/images/icons/lessen.png")%>" width="12" height="12"
                                    alt="-" /></span> <span class="label">
                                        <br />
                                    </span>
            </div>
            <div class="to">
                <br />
                <div class="tips">
                    <div class="label">
                        <%:Resources.SendSMS_Tip %></div>
                    <div class="content">
                        <%:Resources.SendSMS_Tip_Content_Template %></div>
                </div>
                <span class="label"><%:Resources.SendSMS_Template_lbl %></span> <span class="input">
                    <select class="template tipToContent" id="templates" name="template" onchange="onchanges()">
                        <option value=""><%:Resources.SendSMS_Template_dropdown %></option>
                        <% if (Model != null)
                           {
                               foreach (var info in Model.Tinfos)
                               {
                        %>
                        <option value="<%: info.Content %>">
                            <%: info.ContentSub %></option>
                        <% }%>
                        <%} %>
                    </select>
                </span><span class="label"></span>
            </div>
            <div class="to">
                <br />
                <div class="tips">
                    <div class="label">
                        <%:Resources.SendSMS_Tip %>
                    </div>
                        <div class="content">
                        <%:Resources.SendSMS_Tip_Content_Content %>
                        </div>
                </div>
                <span class="label"><%:Resources.SendSMS_Content %></span> <span class="input">
                    <textarea id="smsTemplate" name="addresslists" class="addresslists"><%:Model.content %></textarea>
                </span>
            </div>
            <div class="button">
                <span class="label">&nbsp;</span><input name="sendsmsbutton" type="submit" class="button"
                    value="<%:Resources.All_Send %>" /> <%: TempData["msg"] %>
            </div>
            <%--<span class="label">
                <p>
                </p>
            </span>--%>
            
                
            
            <%   } %>
        </div>
    </div>
    <div class="popupwin">
        <div id="datagrid">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <thead>
                    <tr>
                        <td width="40%">
                            <input type="checkbox" id="selectall" onclick="selectall()" /><%:Resources.All_Contact %>
                        </td>
                        <td>
                            <%:Resources.All_Number %>
                        </td>
                    </tr>
                </thead>
            </table>
            <div class="addresslist">
                <table border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                        <% if (Model != null && Model.Infos != null && Model.Infos.Count > 0)
                           {%>
                        <%  foreach (var info in Model.Infos)
                            {%>
                        <tr>
                            <td width="40%">
                                <input name="contactname" type="checkbox" value="<%: info.Name %>" /><%: info.Name %>
                            </td>
                            <td>
                                <%: info.Number %>
                            </td>
                            <% }%>
                          
                        </tr>
                          <%  }     
                           else
                           { %>
                        <tr>
                            <td align="center" colspan="2">
                                <%:Resources.SendSMS_To_Text %>
                            </td>
                        </tr>
                        <%} %>
                    </tbody>
                </table>
            </div>         
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <link rel="stylesheet" type="text/css" href="<%:Url.Content("~/Content/css/themes/default/easyui.css")%>" />
    <link rel="stylesheet" type="text/css" href="<%:Url.Content("~/Content/css/themes/icon.css")%>" />
    <link href="<%:Url.Content("~/Content/css/icons.css")%>" rel="stylesheet" type="text/css" />
    <link href="<%:Url.Content("~/Content/css/sendsms.css")%>" rel="stylesheet" type="text/css" />
    <script src="<%:Url.Content("~/Content/js/jquery.bgiframe.js")%>"></script>
    <script src="<%:Url.Content("~/Content/js/jquery.easyui.js")%>"></script>
    <script src="<%:Url.Content("~/Content/js/jquery.mask.js")%>"></script>
    <script src="<%:Url.Content("~/Content/js/jquery.alcatel.sendsms.js")%>"></script>
    <script type="text/javascript">
        function onchanges() {
            document.getElementById("smsTemplate").value = document.getElementById("templates").value;
        }

        $(document).ready(function () {
            var $this = $("#sendSMS_CSS")
            $this.addClass("current")
        })

        function selectall() {
            var cb = document.getElementById("selectall").checked;
            if (cb) {
                var selects = document.getElementsByName("contactname");
                var len = selects.length;
                for (var i = 0; i < len; i++) {
                    selects[i].checked = true;
                }
            }
            else {
                var selects = document.getElementsByName("contactname");
                var len = selects.length;
                for (var i = 0; i < len; i++) {
                    selects[i].checked = false;
                } 
            }
        }

    </script>
</asp:Content>
